#!/usr/bin/perl

# Copyright 2012 Adam Parish

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#  http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# use module
use XML::Simple;

# create object
$xml = new XML::Simple;

# URI Resource
my $url = "https://api.twitter.com/1/users/show.xml?screen_name=$ARGV[0]";

# Make XML File
my $webdata = `curl -s $url 2>&1`;

# read XML file
$data = $xml->XMLin($webdata);

# access XML data
print "\nID: $data->{id}\n";
print "Name: $data->{name}\n";
print "Screen Name: $data->{screen_name}\n";
print "Number of Updates: $data->{statuses_count}\n";
print "Last Update: $data->{status}->{created_at}\n";
print "Account Created: $data->{created_at}\n";
print "Verified: $data->{verified}\n\n";

